package com.demiroot.server;

import java.util.ArrayList;
import java.util.List;

public class Logger {
	
	private static List<String> log = new ArrayList<String>();
	
	public static void addLoggerEvent(String evt){
		log.add(evt.toLowerCase());
	}
	
	public static void remvoeLoggerEvent(String evt) {
		log.remove(evt.toLowerCase());
	}
	
	public static void log(String evt, Object msg) {
		if (evt.equals("error")) {
			System.err.println(msg);
			return;
		}
		if (log.contains("none")) return;
		if (log.contains(evt.toLowerCase()) || log.contains("all")) {
			System.out.println(msg);
		}
	}
	
}
